#include <Ice/Ice.h>
#include <YafridngNodeServiceI.h>
#include <YafridngNodeManagerI.h>

using namespace std;

extern "C"{
  YAFRIDNG_API IceBox::Service*
  create(Ice::CommunicatorPtr communicator)
  {
    return new YafridngNodeServiceI;
  }
}

void YafridngNodeServiceI::start(const std::string& name,
			     const Ice::CommunicatorPtr& communicator,
			     const Ice::StringSeq& args)
{
  _adapter = communicator->createObjectAdapter("YafridngAdapter");
  _adapter->add(new YafridngNodeManagerI, communicator->stringToIdentity("YafridngNodeManager"));
  _adapter->activate();
}

void YafridngNodeServiceI::stop()
{
  _adapter->deactivate();
}
